<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="liguangdong">
<title>客户分级规则制定</title>
<script language="javascript" src="../script/common.js"
	type="text/javascript"></script>
<script language="javascript" type="text/javascript">

       var org = Common.cOrg();		  //当前单位
       var qt = {};				     //数据表格对象
	   var qt3={};
	   var qt5={};
	   var qt6={};
	  var operatorName=Common.cOperator().name;
	   function load(){
	   Eui.showNavigation(); 	
	    searchGrade(); //当进入首页面的时候就先进行查找有没有＇初始化＇状态的计划，若有则把'增加'按纽设置成灰色
	　　 Common.initDict(viewdate.flag, "change_state", "请选择");
		setPages(["listview","gradeRulelist",'group_addRule','group_updateRule','gradeRulelist89']);
		createTable();
		showData();
		}
    function showData(){
           qt.showTable();
     }
     //查找有没有初始化的分级计划
     function searchGrade()
     {
       DWR.call('gradeService.isHaveNewGrade',function(v){
		            if(v){
		               $("viewdate").bin.disabled=true;
		            }else{
		               $("viewdate").bin.disabled=false;
		            }
		            b=v;
		    });
     }
		//生成表格，刚开始进入页面显示的页面　创建QueryTable对象  用来显示'正在运行和初始化'的等级计划 
		function createTable(){
			var columns =[];
				//columns[1]={render:function(v){return v.format();}}
				//columns[2]={render:function(v){return v.format();}}
			   columns[10]={title:"操作",width:"12%",align:"center",render:chakan1,order:false}
			   columns[11]={title:"操作",width:"12%",align:"center",render:delect,order:false}
			   qt = new QueryTable("loy_gradeSchemeStatus","viewdate","datalist",columns);
		}
		function showData1()
		{
		  createTable6();
		   qt6.showTable();
		}
		function createTable6(){
			 var columns =[];
			 columns[10]={title:"操作",width:"12%",align:"center",render:chakan1,order:false}
			 columns[11]={title:"操作",width:"12%",align:"center",render:delect,order:false}
			 qt6 = new QueryTable("loy_gradeScheme","viewdate","datalist",columns);
			
			
		}
		function send12()                 //修改后的发送审核
		{
		    if(showQuestion("您确认要发送审核?")==false){
				return;
			}
			DWR.call('gradeService.isHasGradeRule',$('updatePersonRuleForm').schemeid.value,function(v)
			{
			 if(v){
			  DWR.call('gradeService.sendScheme',$('updatePersonRuleForm').schemeid.value,function(t){
				 showInformation("审核发送成功!");
				 sendBin12.disabled=true;
				 if($("updatePersonRuleForm").btnPersonRuleSave.disabled==false)
				 {
				 // $("addPersonRuleForm").btnPersonRuleSave.disabled=false;
				  $("updatePersonRuleForm").btnPersonRuleSave.disabled=true;
				 }
				 if($("updatePersonRuleForm").btnPersonRuleEdit.disabled==false)
				 {
				   $("updatePersonRuleForm").btnPersonRuleEdit.disabled=true;
				 }
				 if($("updateComRuleForm").btnComRuleSave.disabled==false)
				   {
				     $("updateComRuleForm").btnComRuleSave.disabled=true;
				   }
				 if($("updateComRuleForm").btnRuleEditCom.disabled==false)
				  {
				    $("updateComRuleForm").btnRuleEditCom.disabled=true;
				  }
				  if($('updateDriverRuleForm').btnDriverRule.disabled==false)
				  {
				   $('updateDriverRuleForm').btnDriverRule.disabled=true;
				  }
				  if($('updateDriverRuleForm').btnEditDriverRule.disabled==false)
				  {
				   $('updateDriverRuleForm').btnEditDriverRule.disabled=true;
				  }
			});
			}
			else{
			    showInformation("此计划没有创建规则,不能发送审核!");
			}
		 });
		}
		
		function send11()               //新建一个新的计划后的发送审核
		{
		　 
		    if(showQuestion("您确认要发送审核?")==false){
				return;
			}
			DWR.call('gradeService.isHasGradeRule',$('addPersonRuleForm').schemeid.value,function(v)
			{
			 if(v){
			  DWR.call('gradeService.sendScheme',$('addPersonRuleForm').schemeid.value,function(t){
				 showInformation("审核发送成功!");
				 sendBin11.disabled=true;
				 if($("addPersonRuleForm").btnPersonRuleSave.disabled==false)
				 {
				 // $("addPersonRuleForm").btnPersonRuleSave.disabled=false;
				  $("addPersonRuleForm").btnPersonRuleSave.disabled=true;
				 }
				 if($("addPersonRuleForm").btnPersonRuleEdit.disabled==false)
				 {
				   $("addPersonRuleForm").btnPersonRuleEdit.disabled=true;
				 }
				 if($("addComRuleForm").btnComRuleSave.disabled==false)
				   {
				     $("addComRuleForm").btnComRuleSave.disabled=true;
				   }
				 if($("addComRuleForm").btnRuleEditCom.disabled==false)
				  {
				    $("addComRuleForm").btnRuleEditCom.disabled=true;
				  }
				  if($('addDriverRuleForm').btnDriverRule.disabled==false)
				  {
				   $('addDriverRuleForm').btnDriverRule.disabled=true;
				  }
				  if($('addDriverRuleForm').btnEditDriverRule.disabled==false)
				  {
				   $('addDriverRuleForm').btnEditDriverRule.disabled=true;
				  }
				
                
			});
			}
			else{
			    showInformation("此计划没有创建规则,不能发送审核!");
			}
		 });
		}
	
		function delect(v,r)
		{
		   if(r[5]=="初始化")
		   {
		   
		      return "<a href=# onclick=\"onEdit9('"+r[0]+"','"+r[1]+"','"+r[2]+"','"+r[3]+"','"+r[4]+"','"+r[5]+"','"+r[6]+"','"+r[7]+"');return false;\">删除</a>"
		    }
		    else
		    {
		     
		         return "<a href=# onclick=\><font color=\"gray\">删除</font></a>"
		       
		     }
		}
		
		function showTab(id, obj) {
           if(id == "addPersonRule"){
          	 $("addComRule").style.display="none";
          	 $("addPersonRule").style.display="";
          	 $("addDriverRule").style.display="none";
          	 $("updateComRule").style.display="none";
            $("updatePersonRule").style.display="none";
            $("updateDriverRule").style.display="none";
          	 $("tab_base").className = "treeTabc"; 
          	 $("tab_role").className = "treeTab"; 
          	 $("tab_aaa").className = "treeTab"; 
            }else if(id == "addComRule")
            {
             $("addComRule").style.display="";
          	 $("addPersonRule").style.display="none";
          	 $("addDriverRule").style.display="none";
          	 $("updateComRule").style.display="none";
             $("updatePersonRule").style.display="none";
             $("updateDriverRule").style.display="none";
          	 $("tab_base").className = "treeTab"; 
          	 $("tab_role").className = "treeTabc"; 
          	 $("tab_aaa").className = "treeTab"; 
            }
            else{
                 $("updateComRule").style.display="none";
                 $("updatePersonRule").style.display="none";
                 $("updateDriverRule").style.display="none";
         		 $("addComRule").style.display="none";
          	     $("addPersonRule").style.display="none";
          	     $("addDriverRule").style.display="";
          	     $("tab_aaa").className = "treeTabc"; 
          	     $("tab_base").className = "treeTab"; 
          	     $("tab_role").className = "treeTab"; 
       }
}
       function showTabUpdate(id, obj) {
           if(id == "updatePersonRule"){
          	 $("updateComRule").style.display="none";
          	 $("updatePersonRule").style.display="";
          	 $("updateDriverRule").style.display="none";
          	 $("tab_bbb").className = "treeTabc"; 
          	 $("tab_rrr").className = "treeTab"; 
          	 $("tab_zzz").className = "treeTab"; 
            }else if(id == "updateComRule")
            {
             $("updateComRule").style.display="";
          	 $("updatePersonRule").style.display="none";
          	 $("updateDriverRule").style.display="none";
          	  $("tab_bbb").className = "treeTab"; 
          	  $("tab_rrr").className = "treeTabc"; 
          	  $("tab_zzz").className = "treeTab"; 
            }
            else{
         		 $("updateComRule").style.display="none";
          	     $("updatePersonRule").style.display="none";
          	     $("updateDriverRule").style.display="";
          	     $("tab_zzz").className = "treeTabc"; 
          	     $("tab_bbb").className = "treeTab"; 
          	     $("tab_rrr").className = "treeTab"; 
       }
}
		function onEdit9(id,code){
		
			if(showQuestion("您确认删除此计划?")==false){
			
				return;
			}
			DWR.call('gradeService.deleteScheme',id,function(t){
			 　　 searchGrade();
				 showData() ;
			});
		}
		function update11(id,code,createDate,startdate,enddate,flag,opinion)		
		{
		      $('updatePersonRuleForm').schemeid.value=id;
		      $('updateComRuleForm').schemeid.value=id;
		      $('updateDriverRuleForm').schemeid.value=id;
		      var i;
		      var j;
		      var k;
		      DWR.call('gradeService.findGradePersonRule',id,1,1,function(v){			       
			         if(v!=null){
			              $('updatePersonRuleForm')["grade"+1].value=v.grade;
			              $('updatePersonRuleForm')["startGasTimes"+1].value=v.startGasTimes;			            
			              $('updatePersonRuleForm')["endasTimes"+1].value=v.endasTimes;
			              $('updatePersonRuleForm')['startPoints'+1].value=v.startPoints;
			              $('updatePersonRuleForm')['endPoints'+1].value=v.endPoints;
			          }
			        });
			        
			 DWR.call('gradeService.findGradePersonRule',id,2,1,function(v){			       
			         if(v!=null){			              
			              $('updatePersonRuleForm')["grade"+2].value=v.grade;
			              $('updatePersonRuleForm')["startGasTimes"+2].value=v.startGasTimes;
			              $('updatePersonRuleForm')["endasTimes"+2].value=v.endasTimes;
			              $('updatePersonRuleForm')['startPoints'+2].value=v.startPoints;
			              $('updatePersonRuleForm')['endPoints'+2].value=v.endPoints;			            
			          }
			        });
			 DWR.call('gradeService.findGradePersonRule',id,3,1,function(v){			       
			         if(v!=null){			              
			              $('updatePersonRuleForm')["grade"+3].value=v.grade;
			              $('updatePersonRuleForm')["startGasTimes"+3].value=v.startGasTimes;
			              $('updatePersonRuleForm')["endasTimes"+3].value=v.endasTimes;
			              $('updatePersonRuleForm')['startPoints'+3].value=v.startPoints;
			              $('updatePersonRuleForm')['endPoints'+3].value=v.endPoints;			            
			          }
			        });
			 DWR.call('gradeService.findGradePersonRule',id,4,1,function(v){			       
			         if(v!=null){			              
			              $('updatePersonRuleForm')["grade"+4].value=v.grade;
			              $('updatePersonRuleForm')["startGasTimes"+4].value=v.startGasTimes;	
			              $('updatePersonRuleForm')["endasTimes"+4].value=v.endasTimes;
			              $('updatePersonRuleForm')['startPoints'+4].value=v.startPoints;
			              $('updatePersonRuleForm')['endPoints'+4].value=v.endPoints;		            
			          }
			        });
			   DWR.call('gradeService.findGradePersonRule',id,1,2,function(v){			       
			         if(v!=null){
			              $('updateComRuleForm')["grade"+5].value=v.grade;
			              $('updateComRuleForm')["startGasTimes"+5].value=v.startGasTimes;			            
			              $('updateComRuleForm')["endasTimes"+5].value=v.endasTimes;
			              $('updateComRuleForm')['startPoints'+5].value=v.startPoints;
			              $('updateComRuleForm')['endPoints'+5].value=v.endPoints;
			          }
			        });
			        
			 DWR.call('gradeService.findGradePersonRule',id,2,2,function(v){			       
			         if(v!=null){			              
			              $('updateComRuleForm')["grade"+6].value=v.grade;
			              $('updateComRuleForm')["startGasTimes"+6].value=v.startGasTimes;
			              $('updateComRuleForm')["endasTimes"+6].value=v.endasTimes;
			              $('updateComRuleForm')['startPoints'+6].value=v.startPoints;
			              $('updateComRuleForm')['endPoints'+6].value=v.endPoints;			            
			          }
			        });
			 DWR.call('gradeService.findGradePersonRule',id,3,2,function(v){			       
			         if(v!=null){			              
			              $('updateComRuleForm')["grade"+7].value=v.grade;
			              $('updateComRuleForm')["startGasTimes"+7].value=v.startGasTimes;
			              $('updateComRuleForm')["endasTimes"+7].value=v.endasTimes;
			              $('updateComRuleForm')['startPoints'+7].value=v.startPoints;
			              $('updateComRuleForm')['endPoints'+7].value=v.endPoints;			            
			          }
			        });
			 DWR.call('gradeService.findGradePersonRule',id,4,2,function(v){			       
			         if(v!=null){			              
			              $('updateComRuleForm')["grade"+8].value=v.grade;
			              $('updateComRuleForm')["startGasTimes"+8].value=v.startGasTimes;	
			              $('updateComRuleForm')["endasTimes"+8].value=v.endasTimes;
			              $('updateComRuleForm')['startPoints'+8].value=v.startPoints;
			              $('updateComRuleForm')['endPoints'+8].value=v.endPoints;		            
			          }
			        });
			  DWR.call('gradeService.findGradePersonRule',id,1,3,function(v){			       
			         if(v!=null){
			              $('updateDriverRuleForm')["grade"+9].value=v.grade;
			              $('updateDriverRuleForm')["startGasTimes"+9].value=v.startGasTimes;			            
			              $('updateDriverRuleForm')["endasTimes"+9].value=v.endasTimes;
			              $('updateDriverRuleForm')['startPoints'+9].value=v.startPoints;
			              $('updateDriverRuleForm')['endPoints'+9].value=v.endPoints;
			          }
			        });
			        
			 DWR.call('gradeService.findGradePersonRule',id,2,3,function(v){			       
			         if(v!=null){			              
			              $('updateDriverRuleForm')["grade"+10].value=v.grade;
			              $('updateDriverRuleForm')["startGasTimes"+10].value=v.startGasTimes;
			              $('updateDriverRuleForm')["endasTimes"+10].value=v.endasTimes;
			              $('updateDriverRuleForm')['startPoints'+10].value=v.startPoints;
			              $('updateDriverRuleForm')['endPoints'+10].value=v.endPoints;			            
			          }
			        });
			 DWR.call('gradeService.findGradePersonRule',id,3,3,function(v){			       
			         if(v!=null){			              
			              $('updateDriverRuleForm')["grade"+11].value=v.grade;
			              $('updateDriverRuleForm')["startGasTimes"+11].value=v.startGasTimes;
			              $('updateDriverRuleForm')["endasTimes"+11].value=v.endasTimes;
			              $('updateDriverRuleForm')['startPoints'+11].value=v.startPoints;
			              $('updateDriverRuleForm')['endPoints'+11].value=v.endPoints;			            
			          }
			        });
			 DWR.call('gradeService.findGradePersonRule',id,4,3,function(v){			       
			         if(v!=null){			              
			              $('updateDriverRuleForm')["grade"+12].value=v.grade;
			              $('updateDriverRuleForm')["startGasTimes"+12].value=v.startGasTimes;	
			              $('updateDriverRuleForm')["endasTimes"+12].value=v.endasTimes;
			              $('updateDriverRuleForm')['startPoints'+12].value=v.startPoints;
			              $('updateDriverRuleForm')['endPoints'+12].value=v.endPoints;		            
			          }
			        });      
			   switchPage('group_updateRule');
			   showTabUpdate('updatePersonRule',this);	
		}
		 function createTable3(){                        //点击'查看'后　等级计划明细 列表 
			var columns=[];
			 qt3= new QueryTable("loy_gradeRule","gradeRulelistform","gradelist",columns,{showData:"true",
					buttons:[
					     {value:"返 回",actions:Cancel}
					]
				});
			qt3.showTable();
		}
		function createTable5(){                    //点击'查看'后　等级计划明细 列表 
			var columns=[];
			 qt5 = new QueryTable("loy_gradeRule89","gradeRulelistform89","gradelist89",columns,{showData:"true",
					buttons:[
					     {value:"返 回",actions:Cancel}
					]
				});
			qt5.showTable();
		}
	   //点击'添加'按纽触发该事件
		function addRule(){
		   switchPage('group_addRule');	
		   showTab('addPersonRule',this);
		}
	 function updaterule()
	 {
		    var i;
		    var PersonType=$('updatePersonRuleForm').PersonType.value;
	        var schemeid=$('updatePersonRuleForm').schemeid.value;
	       for(i=1;i<5;i++)
	       {
	        var j=i+1;
            var startGasTimesi=$('updatePersonRuleForm')["startGasTimes"+i].value;
            var endasTimesi=$('updatePersonRuleForm')['endasTimes'+i].value;
            var startPointsi=$('updatePersonRuleForm')['startPoints'+i].value;
            var endPointsi=$('updatePersonRuleForm')['endPoints'+i].value;
            var timesi=Number(startGasTimesi);
	        var timesj=Number(endasTimesi);
	        var pointi=Number(startPointsi);
	        var pointj=Number(endPointsi);
	        if(timesj==0)
	      {
	         showQuestion("加油次数上限不能为0");
	         return;
	      }
	      else if(timesi>=timesj)
	        {
	          showQuestion("加油次数上限必须大于加油次数下限");
	          return;
	        }
	      else if(pointj==0)
	        {
	         showQuestion("累计积分上限不能为0");
	         return;
	        }
	      else if(pointi>=pointj)
	        {
	           showQuestion("累计积分上限必须大于累计积分下限");
	           return;
	        }
			else{ 
			 var gradei=$('updatePersonRuleForm')['grade'+i].value;
			DWR.call('gradeService.createGradeRule',schemeid,startGasTimesi,endasTimesi,startPointsi,endPointsi,gradei,PersonType,function(t){
		        });
		        }
		  }
		  $('updatePersonRuleForm').btnPersonRuleSave.disabled=true;
		  showInformation("个人帐户规则修改成功!"); 
		  if(showQuestion("继续修改单位帐户吗?")==true)
		  {
		   showTabUpdate('updateComRule',this); 
		  }
	 }
	 function  updateRuleComRule()
	 {
	       var i;
		   var ComType=$('updateComRuleForm').ComType.value;
	       var schemeid=$('updateComRuleForm').schemeid.value;
	       for(i=5;i<9;i++)
	       {
	        var j=i+1;
            var startGasTimesi=$('updateComRuleForm')["startGasTimes"+i].value;
            var endasTimesi=$('updateComRuleForm')['endasTimes'+i].value;
            var startPointsi=$('updateComRuleForm')['startPoints'+i].value;
            var endPointsi=$('updateComRuleForm')['endPoints'+i].value;
            var timesi=Number(startGasTimesi);
	        var timesj=Number(endasTimesi);
	        var pointi=Number(startPointsi);
	        var pointj=Number(endPointsi);
	    
	        if(timesj==0)
	      {
	         showQuestion("加油次数上限不能为0");
	         return;
	      }
	      else if(timesi>=timesj)
	        {
	          showQuestion("加油次数上限必须大于加油次数下限");
	          return;
	        }
	      else if(pointj==0)
	        {
	         showQuestion("累计积分上限不能为0");
	         return;
	        }
	      else if(pointi>=pointj)
	        {
	           showQuestion("累计积分上限必须大于累计积分下限");
	           return ;
	        }
			else{ 
			 var gradei=$('updateComRuleForm')['grade'+i].value;
			 DWR.call('gradeService.createGradeRule',schemeid,startGasTimesi,endasTimesi,startPointsi,endPointsi,gradei,ComType,function(t){
			
		        });
		        }
		  }
		  $('updateComRuleForm').btnComRuleSave.disabled=true;
		  showInformation("单位帐户规则修改成功!");
		  if(showQuestion("继续修改司机帐户吗?")==true)
		  {
		   showTabUpdate('updateDriverRule',this); 
		  } 
	 }
	 function UpdateDriverRule()
	 {
	       var i;
		    var DriverType=$('updateDriverRuleForm').DriverType.value;
	        var schemeid=$('updateDriverRuleForm').schemeid.value;
	       for(i=9;i<13;i++)
	       {
	        var j=i+1;
            var startGasTimesi=$('updateDriverRuleForm')["startGasTimes"+i].value;
            var endasTimesi=$('updateDriverRuleForm')['endasTimes'+i].value;
            var startPointsi=$('updateDriverRuleForm')['startPoints'+i].value;
            var endPointsi=$('updateDriverRuleForm')['endPoints'+i].value;
            var timesi=Number(startGasTimesi);
	        var timesj=Number(endasTimesi);
	        var pointi=Number(startPointsi);
	        var pointj=Number(endPointsi);
	        if(timesj==0)
	      {
	         showQuestion("加油次数上限不能为0");
	         return;
	      }
	      else if(timesi>=timesj)
	        {
	          showQuestion("加油次数上限必须大于加油次数下限");
	          return;
	        }
	      else if(pointj==0)
	        {
	         showQuestion("累计积分上限不能为0");
	         return;
	        }
	      else if(pointi>=pointj)
	        {
	           showQuestion("累计积分上限必须大于累计积分下限");
	           return;
	        }
			else{ 
			 var gradei=$('updateDriverRuleForm')['grade'+i].value;
			 DWR.call('gradeService.createGradeRule',schemeid,startGasTimesi,endasTimesi,startPointsi,endPointsi,gradei,DriverType,function(t){
		        });
		        }
		  }
		  $('updateDriverRuleForm').btnDriverRule.disabled=true;
		  showQuestion("司机帐户规则修改成功!"); 
	 }
		//取消跳转             
		function Cancel()
		{
			 createTable();
			 searchGrade();
		     showData();
		     $("addPersonRule").style.display="none";
		     $("addComRule").style.display="none";
          	 $("addDriverRule").style.display="none";
          	 $("updatePersonRule").style.display="none";
		     $("updateComRule").style.display="none";
          	 $("updateDriverRule").style.display="none";
			 switchPage('listview');
		}
		function chakan1(v,r){
		
	      if(r[5]=="初始化")
	      {
	      　　 return "<a href=# onclick=\"update11('"+r[0]+"','"+r[1]+"','"+r[2]+"','"+r[3]+"','"+r[4]+"','"+r[5]+"','"+r[6]+"','"+r[9]+"');return false;\">修改</a>"
	      }
	      else if(r[6]=="运行态"||r[5]=="审核通过"||r[5]=="审核未通过")
	      {
	        return "<a href=# onclick=\"see2('"+r[0]+"','"+r[1]+"','"+r[2]+"','"+r[3]+"','"+r[4]+"','"+r[5]+"','"+r[6]+"','"+r[9]+"');return false;\">查看</a>"
	      }
		else {
		//等待审核状态
		    return "<a href=# onclick=\"see3('"+r[0]+"','"+r[1]+"','"+r[2]+"','"+r[3]+"','"+r[4]+"','"+r[5]+"','"+r[6]+"','"+r[9]+"');return false;\">查看</a>"
		}
   }
			function see2(id,code,createDate,startdate,enddate,flag,status,opinion)
			{ 
			  $("gradeRulelistform").orderid.value=id;
			  $("gradeRulelistform").chakanSchemeid.value=id; 　　　　　　　　　　　　　　
			  $('gradeRulelistform').status.value=status;
			  $("gradeSchemeFlag").value=flag;
			 // $("gradeSchemeCode").innerHTML=code;
			  $("gradeSchemeFlag").innerHTML=flag;
		      $("gradeSchemeCreator").innerHTML=operatorName;
		      $("gradeSchemeChecker").innerHTML=operatorName;
               if(flag=="初始化"||flag=="等待审核")
                {
                 $('opionions').innerHTML=" ";
                }
              else {
                 if(opinion=="null")
                 {
                  $('opionions').innerHTML=" ";
                 }
                 else
                  {
		           $('opionions').innerHTML=opinion.toString();
		          } 
              }
		      createTable3();
			  switchPage("gradeRulelist");
		}
		  function see3(id,code,createDate,startdate,enddate,flag,status,opinion)
			  { 
			  $("gradeRulelistform89").orderid89.value=id;
			  $('gradeRulelistform89').status89.value=status;
			  $("gradeSchemeFlag89").value=flag;
			 
			  createTable5();
			  //$("gradeSchemeCode89").innerHTML=code;
			  $("gradeSchemeFlag89").innerHTML=flag;
		      $("gradeSchemeCreator89").innerHTML=operatorName;
		      $("gradeSchemeChecker89").innerHTML=operatorName;
			  switchPage("gradeRulelist89");
			}
			//解灰
			function editPersonRule()
			{
			 $("addPersonRuleForm").btnPersonRuleSave.disabled=false;
			}
			function editCom()
			{
			 $("addComRuleForm").btnComRuleSave.disabled=false;
			}
			function editDriverRule()
			{
			 $("addDriverRuleForm").btnDriverRule.disabled=false;
			}
			function editPersonRuleUpdate()
			{
			 $("updatePersonRuleForm").btnPersonRuleSave.disabled=false;
			}
			function editComUpdate()
			{
			  $("updateComRuleForm").btnComRuleSave.disabled=false;
			}
			function editDriverRuleUpdate()
			{
			 $("updateDriverRuleForm").btnDriverRule.disabled=false;
			}
			
		//查找初始化状态的分级计划,若没有则创建一个新的分级计划
		function createGradeSchemePer()
		{
		   
			var i;
		    var PersonType=$('addPersonRuleForm').PersonType.value;
	        var schemeid=$('addPersonRuleForm').schemeid.value;
	       for(i=1;i<5;i++)
	       {
	        var j=i+1;
            var startGasTimesi=$('addPersonRuleForm')["startGasTimes"+i].value;
            var endasTimesi=$('addPersonRuleForm')['endasTimes'+i].value;
            var startPointsi=$('addPersonRuleForm')['startPoints'+i].value;
            var endPointsi=$('addPersonRuleForm')['endPoints'+i].value;
            var timesi=Number(startGasTimesi);
	        var timesj=Number(endasTimesi);
	        var pointi=Number(startPointsi);
	        var pointj=Number(endPointsi);
	        if(timesj==0)
	      {
	         showQuestion("加油次数上限不能为0");
	         return;
	      }
	      else if(timesi>=timesj)
	        {
	          showQuestion("加油次数上限必须大于加油次数下限");
	          return;
	        }
	      else if(pointj==0)
	        {
	         showQuestion("累计积分上限不能为0");
	         return;
	        }
	      else if(pointi>=pointj)
	        {
	           showQuestion("累计积分上限必须大于累计积分下限");
	           return;
	        }
			else{ 
			 var gradei=$('addPersonRuleForm')['grade'+i].value;
			DWR.call('gradeService.createGradeRule',schemeid,startGasTimesi,endasTimesi,startPointsi,endPointsi,gradei,PersonType,function(t){
		        });
		        }
		  }
		  $('addPersonRuleForm').btnPersonRuleSave.disabled=true;
		  showInformation("个人帐户规则添加成功!");
		  if(showQuestion("继续添加单位帐户吗?")==true)
		  {
		       showTab('addComRule',this); 
		  } 
		}
		function saverule(){
		   	        DWR.call('gradeService.createGradeScheme',function(t){
		   	        $('addPersonRuleForm').schemeid.value=t.id;
		   	        $('addComRuleForm').schemeid.value=t.id;
		   	        $('addDriverRuleForm').schemeid.value=t.id;
		   	        createGradeSchemePer();
			     });
		}
		function createGradeSchemeCom()
		{
		    var i;
		    var ComType=$('addComRuleForm').ComType.value;
	        var schemeid=$('addComRuleForm').schemeid.value;
	       for(i=5;i<9;i++)
	       {
	        var j=i+1;
            var startGasTimesi=$('addComRuleForm')["startGasTimes"+i].value;
            var endasTimesi=$('addComRuleForm')['endasTimes'+i].value;
            var startPointsi=$('addComRuleForm')['startPoints'+i].value;
            var endPointsi=$('addComRuleForm')['endPoints'+i].value;
            var timesi=Number(startGasTimesi);
	        var timesj=Number(endasTimesi);
	        var pointi=Number(startPointsi);
	        var pointj=Number(endPointsi);
	        if(timesj==0)
	      {
	         showQuestion("加油次数上限不能为0");
	         return;
	      }
	      else if(timesi>=timesj)
	        {
	          showQuestion("加油次数上限必须大于加油次数下限");
	          return;
	          
	        }
	      else if(pointj==0)
	        {
	         showQuestion("累计积分上限不能为0");
	         return;
	        }
	      else if(pointi>=pointj)
	        {
	           showQuestion("累计积分上限必须大于累计积分下限");
	           return ;
	        }
			else{ 
			 var gradei=$('addComRuleForm')['grade'+i].value;
			 DWR.call('gradeService.createGradeRule',schemeid,startGasTimesi,endasTimesi,startPointsi,endPointsi,gradei,ComType,function(t){
		        });
		        }
		  }
		  $('addComRuleForm').btnComRuleSave.disabled=true;
		  showInformation("单位帐户规则添加成功!");
		  if(showQuestion("继续添加司机帐户吗?")==true)
		    {
		       showTab('addDriverRule',this); 
		    } 
		}
		function saveruleComRule(){
		 
		   	   DWR.call('gradeService.createGradeScheme',function(t){
		   	        $('addPersonRuleForm').schemeid.value=t.id;
		   	        $('addComRuleForm').schemeid.value=t.id;
		   	        $('addDriverRuleForm').schemeid.value=t.id;
		   	        createGradeSchemeCom();
			     });
		}
		function  createGradeSchemeDriver()
		  {
		    var i;
		    var DriverType=$('addDriverRuleForm').DriverType.value;
	        var schemeid=$('addDriverRuleForm').schemeid.value;
	       for(i=9;i<13;i++)
	       {
	        var j=i+1;
            var startGasTimesi=$('addDriverRuleForm')["startGasTimes"+i].value;
            var endasTimesi=$('addDriverRuleForm')['endasTimes'+i].value;
            var startPointsi=$('addDriverRuleForm')['startPoints'+i].value;
            var endPointsi=$('addDriverRuleForm')['endPoints'+i].value;
            var timesi=Number(startGasTimesi);
	        var timesj=Number(endasTimesi);
	        var pointi=Number(startPointsi);
	        var pointj=Number(endPointsi);
	       
	        if(timesj==0)
	      {
	         showQuestion("加油次数上限不能为0");
	         return;
	      }
	      else if(timesi>=timesj)
	        {
	          showQuestion("加油次数上限必须大于加油次数下限");
	          return;
	        }
	      else if(pointj==0)
	        {
	         showQuestion("累计积分上限不能为0");
	         return;
	        }
	      else if(pointi>=pointj)
	        {
	           showQuestion("累计积分上限必须大于累计积分下限");
	           return;
	        }
			else{ 
			 var gradei=$('addDriverRuleForm')['grade'+i].value;
			
			 DWR.call('gradeService.createGradeRule',schemeid,startGasTimesi,endasTimesi,startPointsi,endPointsi,gradei,DriverType,function(t){
		        });
		        }
		  }
		  $('addDriverRuleForm').btnDriverRule.disabled=true;
		  showInformation("司机帐户规则添加成功!"); 
		  }
		function saveDriverRule(){
		   DWR.call('gradeService.createGradeScheme',function(t){
		   	        $('addPersonRuleForm').schemeid.value=t.id;
		   	        $('addComRuleForm').schemeid.value=t.id;
		   	        $('addDriverRuleForm').schemeid.value=t.id;
		   	        createGradeSchemeDriver();
			     });
	}
 </script>
</head>	
<body onload="load()">
<!--页面导航-->
<div class=" nav ">
<div id="nav">&nbsp;</div>
</div>
<div id="content"><!--查询静态页面部分-->
<div id=listview>
<div class="formTitle">客户分级制定</div>
<div class="form">
<form name="viewdate" id="viewdate" action="">
<div class="searchForm">
<table cellSpacing="0" cellPadding="4" width="100%" border="0"
	class="col2 label6">
	<tr>
		<td><label>计划状态</label> <select name="flag"></select></td>
		 <td><label>运行日期</label> <input type="text"
						name="runDate" id="runDate" onBlur="checkV(this,'date')"><img align='absMiddle' onmouseup='showDatePicker("runDate" );' src="../images/icon/date.gif" alt="选择日期" style="CURSOR: hand" border="0">
						</td>
	</tr>
	<tr>
	<td></td>	
	<td></td>
	<td><button type="button" onclick="showData1()">查 询</button></td>
	<td><button type="button" id="bin" onclick="addRule()">增 加</button></td>
	</tr>
</table>
</div>
</form>
</div>
<div id=datalist></div>
</div>
</div>

<div id="gradeRulelist" style="display:none;">
			<div class="form">
				<form id="gradeRulelistform" name="listform1" action="">
				    <input type="hidden" name="orderid">
					<input type="hidden" name="oid">
					<input type="hidden" name="chakanSchemeid">
					<input type="hidden" name="status">
					<div class="formTitle">分级计划</div>
					<table cellSpacing=0 cellPadding=4 width="100%" border=0 class="col2 label6">
						    <tr>
							  
							     <td><label>计划创建者&nbsp;&nbsp;</label> <span id="gradeSchemeCreator"></span></td>
							     <td><label>计划审核者&nbsp;&nbsp;</label> <span id="gradeSchemeChecker"></span></td>
							     
							</tr>
							<tr>
							   <td><label>计划状态</label> <span id="gradeSchemeFlag"></span></td>
							  
							</tr>
							<tr>
							 <td><label>审核意见</label></td>
							</tr>
							<tr>
							<td><textarea name="opionions"   cols="40" rows="2" readonly ></textarea><font></font></td>
							</tr>
					</table>
				</form>	 
			</div>
			<div id="gradelist"></div>	
		</div>
<div id="gradeRulelist89" style="display:none;">     
			<div class="form">
				<form id="gradeRulelistform89" name="listform89" action="">
				    <input type="hidden" name="orderid89">
					<input type="hidden" name="status89">
					<div class="formTitle">分级计划</div>
					<table cellSpacing=0 cellPadding=4 width="100%" border=0 class="col2 label6">
						    
							<tr>
							  <td><label>计划创建者&nbsp;&nbsp;</label> <span id="gradeSchemeCreator89"></span></td>
							  <td><label>计划审核者&nbsp;&nbsp;</label> <span id="gradeSchemeChecker89"></span></td>
						   </tr>
						   <tr>
							    <td><label>计划状态</label> <span id="gradeSchemeFlag89"></span></td>
							</tr>
					</table>
				</form>	 
			</div>
			<div id="gradelist89"></div>	
		</div>
<div id='group_addRule' align="left" style="display: none">
<div class="formTitle">客户分级规则添加</div>
<a href='#' onclick="showTab('addPersonRule',this);" onfocus="this.blur()"
	tabindex="-1" id="tab_base" class="treeTabc">个人帐户规则添加</a> <a href='#'
	onclick="showTab('addComRule',this);" onfocus="this.blur()" tabindex="-1"
	id="tab_role" class="treeTab">单位帐户规则添加</a><a href='#'
	onclick="showTab('addDriverRule',this);" onfocus="this.blur()" tabindex="-1"
	id="tab_aaa" class="treeTab">司机帐户规则添加</a>
 <button type="button" id="sendBin11" name="sendBin11"  onclick="send11()">发送审核</button>
 <button type="button"  name="cancel"  onclick="Cancel()">返 回</button>
</div>
<div id="addPersonRule" style="display: none;">
 <form id="addPersonRuleForm" name="addPersonRuleForm" action="">
<input type="hidden" id="schemeid" name="schemeid">
<input type="hidden" id="chakanschemeidFlag" name="chakanschemeidFlag">
<input type="hidden" id="PersonType" name="PersonType" value="1">
<div class="form">
<div class="formTitle">个人帐户规则添加</div>
<table cellSpacing="0" cellPadding="4" width="100%" border="0"
	class="col2 label6">
	<tr>
	 <td> <label>普卡:</label><input type="hidden" id="grade1" name="grade1" value="1"></td>
	</tr>
	<tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes1" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes1"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	   <td>累计积分范围:从<input size="10" type="text" name="startPoints1" maxLength="9"
			onblur="checkV(this,'number',true)">到
	   <input size="10" type="text" name="endPoints1" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td> <label>银卡:</label><input type="hidden" id="grade2" name="grade2" value="2"></td>
	</tr>
	<tr>
		<td>加油次数范围:从<input size="10"  type="text" name="startGasTimes2" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes2"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	   <td>累计积分范围:从<input size="10"  type="text" name="startPoints2" maxLength="9"
			onblur="checkV(this,'number',true)">到
	   <input size="10" type="text" name="endPoints2" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>金卡:</label><input type="hidden" id="grade3" name="grade3" value="3"></td>
	</tr>
	<tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes3" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes3"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints3" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints3" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	    <td><label>钻卡:</label><input type="hidden" id="grade4" name="grade4" value="4"></td>
	</tr>
   <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes4" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes4"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints4" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints4" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
</table>
</div>
<p>
<button type="button" id="btnPersonRuleSave" onclick="saverule()">确 认</button>
<button type="button" id="btnPersonRuleEdit"  onclick="editPersonRule()">编 辑</button>
</p>
</form>
</div>
<div id="addComRule" style="display: none;">
 <form id="addComRuleForm" name="addComRuleForm" action="">
<input type="hidden" id="schemeid" name="schemeid">
<input type="hidden" id="chakanschemeidFlag" name="chakanschemeidFlag">
<input type="hidden" id="ComType" name="ComType" value="2">
<div class="form">
<div class="formTitle">单位帐户规则添加</div>
<table cellSpacing="0" cellPadding="4" width="100%" border="0"
	class="col2 label6">
	<tr>
	 <td> <label>普卡:</label><input type="hidden" id="grade5" name="grade5" value="1"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes5" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes5"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints5" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints5" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td> <label>银卡:</label><input type="hidden" id="grade6" name="grade6" value="2"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes6" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes6"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints6" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints6" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>金卡:</label><input type="hidden" id="grade7" name="grade7" value="3"></td>
	</tr>
    <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes7" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes7"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints7" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints7" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>			
	 <td><label>钻卡:</label><input type="hidden" id="grade8" name="grade8" value="4">
    </tr>	 
		
 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes8" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes8"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints8" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints8" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
</table>
</div>
<p>
<button type="button" id="btnComRuleSave" onclick="saveruleComRule()">确 认</button>
<button type="button" id="btnRuleEditCom" onclick="editCom()">编 辑</button>
</p>
</form>
</div>

<div id="addDriverRule" style="display: none;">
 <form id="addDriverRuleForm" name="addDriverRuleForm" action="">
<input type="hidden" id="schemeid" name="schemeid">
<input type="hidden" id="chakanschemeidFlag" name="chakanschemeidFlag">
<input type="hidden" id="DriverType" name="DriverType" value="3">
<div class="form">
<div class="formTitle">司机帐户规则添加</div>
<table cellSpacing="0" cellPadding="4" width="100%" border="0"
	class="col2 label6">
	<tr>
	 <td> <label>普卡:</label><input type="hidden" id="grade9" name="grade9" value="1"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes9" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes9"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints9" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints9" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td> <label>银卡:</label><input type="hidden" id="grade10" name="grade10" value="2"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes10" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes10"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints10" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints10" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>金卡:</label><input type="hidden" id="grade11" name="grade11" value="3"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes11" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes11"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints11" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints11" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>钻卡:</label><input type="hidden" id="grade12" name="grade12" value="4"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes12" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes12"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints12" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints12" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
</table>
</div>
<p>
<button type="button" id="btnDriverRule" onclick="saveDriverRule()">确 认</button>
<button type="button" id="btnEditDriverRule" onclick="editDriverRule()">编 辑</button>
</p>
</form>
</div>

<div id='group_updateRule' align="left" style="display: none">
<div class="formTitle">客户分级规则修改</div>
<a href='#' onclick="showTabUpdate('updatePersonRule',this);" onfocus="this.blur()"
	tabindex="-1" id="tab_bbb" class="treeTabc">个人帐户规则修改</a> <a href='#'
	onclick="showTabUpdate('updateComRule',this);" onfocus="this.blur()" tabindex="-1"
	id="tab_rrr" class="treeTab">单位帐户规则修改</a><a href='#'
	onclick="showTabUpdate('updateDriverRule',this);" onfocus="this.blur()" tabindex="-1"
	id="tab_zzz" class="treeTab">司机帐户规则修改</a>
 <button type="button" name="sendBin12"  id="sendBin12" onclick="send12()">发送审核</button>
 <button type="button"  name="cancel111"  onclick="Cancel()">返 回</button>
</div>
<div id="updatePersonRule" style="display: none;">
 <form id="updatePersonRuleForm" name="updatePersonRuleForm" action="">
<input type="hidden" id="schemeid" name="schemeid">
<input type="hidden" id="PersonType" name="PersonType" value="1">
<div class="form">
<div class="formTitle">个人帐户规则修改</div>
<table cellSpacing="0" cellPadding="4" width="100%" border="0"
	class="col2 label6">
	<tr>
	 <td> <label>普卡:</label><input type="hidden" id="grade1" name="grade1" value="1"></td>
	</tr>
    <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes1" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes1"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints1" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints1" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td> <label>银卡:</label><input type="hidden" id="grade2" name="grade2" value="2"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes2" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes2"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints2" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints2" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>金卡:</label><input type="hidden" id="grade3" name="grade3" value="3"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes3" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes3"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints3" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints3" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	    <td><label>钻卡:</label><input type="hidden" id="grade4" name="grade4" value="4" ></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes4" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes4"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints4" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints4" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
</table>
</div>
<p>
<button type="button" id="btnPersonRuleSave" onclick="updaterule()">确 认</button>
<button type="button"  id="btnPersonRuleEdit"onclick="editPersonRuleUpdate()">编 辑</button>
</p>
</form>
</div>
<div id="updateComRule" style="display: none;">
 <form id="updateComRuleForm" name="updateComRuleForm" action="">
<input type="hidden" id="schemeid" name="schemeid">
<input type="hidden" id="ComType" name="ComType" value="2">
<div class="form">
<div class="formTitle">单位帐户规则修改</div>
<table cellSpacing="0" cellPadding="4" width="100%" border="0"
	class="col2 label6">
	<tr>
	 <td> <label>普卡:</label><input type="hidden" id="grade5" name="grade5" value="1"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes5" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes5"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints5" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints5" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td> <label>银卡:</label><input type="hidden" id="grade6" name="grade6" value="2"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes6" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes6"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints6" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints6" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>金卡:</label><input type="hidden" id="grade7" name="grade7" value="3"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes7" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes7"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints7" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints7" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>钻卡:</label><input type="hidden" id="grade8" name="grade8" value="4"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes8" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes8"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints8" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints8" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
</table>
</div>
<p>
<button type="button" id="btnComRuleSave" onclick="updateRuleComRule()">确 认</button>
<button type="button" id="btnRuleEditCom"  onclick="editComUpdate()">编 辑</button>
</p>
</form>
</div>

<div id="updateDriverRule" style="display: none;">
 <form id="updateDriverRuleForm" name="updateDriverRuleForm" action="">
<input type="hidden" id="schemeid" name="schemeid">
<input type="hidden" id="DriverType" name="DriverType" value="3">
<div class="form">
<div class="formTitle">司机帐户规则修改</div>
<table cellSpacing="0" cellPadding="4" width="100%" border="0"
	class="col2 label6">
	<tr>
	 <td> <label>普卡:</label><input type="hidden" id="grade9" name="grade9" value="1"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes9" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes9"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints9" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints9" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td> <label>银卡:</label><input type="hidden" id="grade10" name="grade10" value="2"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes10" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes10"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints10" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints10" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>金卡:</label><input type="hidden" id="grade11" name="grade11" value="3"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes11" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes11"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints11" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints11" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
	<tr>
	 <td><label>钻卡:</label><input type="hidden" id="grade12" name="grade12" value="4"></td>
	</tr>
	 <tr>
		<td>加油次数范围:从<input size="10" type="text" name="startGasTimes12" maxLength="9"
			onblur="checkV(this,'number',true)">到
		<input size="10" type="text" name="endasTimes12"  maxLength="9"
			onblur="checkV(this,'number',true)">次<span class="des">*</span></td>
	 
	    <td>累计积分范围:从<input size="10" type="text" name="startPoints12" maxLength="9"
			onblur="checkV(this,'number',true)">到
	    <input size="10" type="text" name="endPoints12" maxLength="9"
			onblur="checkV(this,'number',true)">分<span class="des">*</span></td>
	</tr>
</table>
</div>
<p>
<button type="button" id="btnDriverRule" onclick="UpdateDriverRule()">确 认</button>
<button type="button" id="btnEditDriverRule" onclick="editDriverRuleUpdate()">编 辑</button>
</p>
</form>
</div>
</body>
</html>